
<!DOCTYPE HTML>
<html lang="zh-hans" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>第七章 函数与预编译 · C语言程序设计精髓程</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        <meta name="author" content="马小安">
        
        
    
    <link rel="stylesheet" href="gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-search-plus/search.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-disqus/plugin.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-prism/prism-base16-ateliersulphurpool.light.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-emphasize/plugin.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-katex/katex.min.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-splitter/splitter.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-terminal/plugin.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="chapter8_1.html" />
    
    
    <link rel="prev" href="chapter6.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="输入并搜索" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="./">
            
                <a href="./">
            
                    
                        <b>1.1.</b>
                    
                    笔记内容介绍
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="chapter1.html">
            
                <a href="chapter1.html">
            
                    
                        <b>1.2.</b>
                    
                    第一章 基础知识
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="chapter2.html">
            
                <a href="chapter2.html">
            
                    
                        <b>1.3.</b>
                    
                    第二章 数据类型
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="chapter3.html">
            
                <a href="chapter3.html">
            
                    
                        <b>1.4.</b>
                    
                    第三章 顺序结构
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="chapter4.html">
            
                <a href="chapter4.html">
            
                    
                        <b>1.5.</b>
                    
                    第四章 选择结构
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="chapter5.html">
            
                <a href="chapter5.html">
            
                    
                        <b>1.6.</b>
                    
                    第五章 循环结构
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="chapter6.html">
            
                <a href="chapter6.html">
            
                    
                        <b>1.7.</b>
                    
                    第六章 数组概念
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.8" data-path="chapter7.html">
            
                <a href="chapter7.html">
            
                    
                        <b>1.8.</b>
                    
                    第七章 函数与预编译
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9" data-path="chapter8_1.html">
            
                <a href="chapter8_1.html">
            
                    
                        <b>1.9.</b>
                    
                    第八章 指针类型(1)
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10" data-path="chapter8_2.html">
            
                <a href="chapter8_2.html">
            
                    
                        <b>1.10.</b>
                    
                    第八章 指针类型(2)
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11" data-path="chapter9_1.html">
            
                <a href="chapter9_1.html">
            
                    
                        <b>1.11.</b>
                    
                    第九章 结构体类型(1)
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12" data-path="chapter9_2.html">
            
                <a href="chapter9_2.html">
            
                    
                        <b>1.12.</b>
                    
                    第九章 结构体类型(2)
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13" data-path="chapter9_3.html">
            
                <a href="chapter9_3.html">
            
                    
                        <b>1.13.</b>
                    
                    第九章 结构体类型(3)
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.14" data-path="chapter10.html">
            
                <a href="chapter10.html">
            
                    
                        <b>1.14.</b>
                    
                    第十章 位运算
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15" data-path="chapter11.html">
            
                <a href="chapter11.html">
            
                    
                        <b>1.15.</b>
                    
                    第十一章 排序算法
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.16" data-path="Glossary.html">
            
                <a href="Glossary.html">
            
                    
                        <b>1.16.</b>
                    
                    其他资源
            
                </a>
            

            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            本书使用 GitBook 发布
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="." >第七章 函数与预编译</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h2 id="&#x51FD;&#x6570;&#x4E0E;&#x9884;&#x7F16;&#x8BD1;">&#x51FD;&#x6570;&#x4E0E;&#x9884;&#x7F16;&#x8BD1;</h2>
<ol>
<li>&#x51FD;&#x6570;&#x7684;&#x5B9A;&#x4E49;<ol>
<li>&#x5B9A;&#x4E49;&#xFF1A;&#x51FD;&#x6570;&#x8FD4;&#x56DE;&#x503C;&#x7C7B;&#x578B; &#x51FD;&#x6570;&#x540D;(&#x5F62;&#x53C2;&#x5217;&#x8868;){&#x51FD;&#x6570;&#x4F53;;}&#xFF08;4+2&#xFF09;&#x90E8;&#x5206;&#x3002;</li>
<li>&#x5F62;&#x53C2;&#x53D8;&#x91CF;&#x7C7B;&#x578B;&#x4E0D;&#x80FD;&#x7701;&#xFF08;&#x73B0;&#x4EE3;&#x65B9;&#x6CD5;&#xFF09;</li>
<li>&#x51FD;&#x6570;&#x540D;&#x9075;&#x5FAA;&#x7528;&#x6237;&#x81EA;&#x5B9A;&#x4E49;&#x6807;&#x8BC6;&#x7B26;&#x89C4;&#x5219;</li>
<li>&#x4E00;&#x4E2A;main&#x51FD;&#x6570;&#xFF0C;&#x4E3A;&#x5355;&#x6846;&#x67B6;</li>
<li>&#x4E00;&#x4E2A;main&#x51FD;&#x6570;+&#x591A;&#x4E2A;&#x5B50;&#x51FD;&#x6570;&#xFF0C;&#x4E3A;&#x590D;&#x5408;&#x6846;&#x67B6;</li>
<li>&#x51FD;&#x6570;&#x8FD4;&#x56DE;&#x503C;&#x7C7B;&#x578B;&#xFF1A;void&#x7C7B;&#x578B;&#xFF08;&#x4E0D;&#x53EF;&#x4EE5;&#x52A0;return&#xFF09;&#xFF0C;&#x975E;void&#x7C7B;&#x578B;&#xFF08;&#x4E00;&#x5B9A;&#x8981;&#x52A0;return&#x8868;&#x8FBE;&#x5F0F;&#xFF09;</li>
</ol>
</li>
<li>&#x51FD;&#x6570;&#x8C03;&#x7528;(&#x51FD;&#x6570;&#x7C7B;&#x578B;)<ol>
<li>&#x65B9;&#x5F0F;1&#xFF1A;&#x975E;void&#x7C7B;&#x578B;&#xFF0C;&#x53D8;&#x91CF;&#x540D;=&#x51FD;&#x6570;&#x540D;(&#x5B9E;&#x53C2;&#x5217;&#x8868;)&#xFF1B;</li>
<li>&#x65B9;&#x5F0F;2&#xFF1A;void&#x7C7B;&#x578B;&#xFF0C;&#x51FD;&#x6570;&#x540D;(&#x5B9E;&#x53C2;&#x5217;&#x8868;)&#xFF1B;</li>
<li>&#x6CE8;&#x610F;&#x4E8B;&#x9879;&#xFF1A;<ul>
<li>&#x770B;&#x6846;&#x67B6;&#xFF08;&#x5355;&#x3001;&#x590D;&#xFF09;</li>
<li>&#x5B50;&#x51FD;&#x6570;&#x8FD4;&#x56DE;&#x503C;&#x7C7B;&#x578B;&#xFF08;void or &#x975E;void&#x7C7B;&#x578B;&#xFF09;</li>
<li>&#x4E3B;&#x51FD;&#x6570;&#x8C03;&#x7528;&#x5B50;&#x51FD;&#x6570;&#x7684;&#x6B21;&#x6570;</li>
<li>&#x6267;&#x884C;&#x8FC7;&#x7A0B;&#xFF08;&#x5355;&#x5411;&#x4F20;&#x503C;&#x9075;&#x5FAA;&#x4E09;&#x4E00;&#x81F4;&#xFF0C;&#x53C2;&#x6570;&#x4E2A;&#x6570;&#x76F8;&#x540C;&#xFF0C;&#x53C2;&#x6570;&#x7C7B;&#x578B;&#x4E00;&#x81F4;&#xFF0C;&#x53C2;&#x6570;&#x4F4D;&#x7F6E;&#x6B21;&#x5E8F;&#x4E00;&#x81F4;&#xFF09;</li>
</ul>
</li>
</ol>
</li>
<li>&#x6CE8;&#xFF1A;<ul>
<li>&#x4E00;&#x4E2A;&#x6E90;&#x7A0B;&#x5E8F;&#x53EF;&#x4EE5;&#x6709;&#x4E00;&#x4E2A;&#x6216;&#x591A;&#x4E2A;&#x51FD;&#x6570;</li>
<li>&#x4E00;&#x4E2A;c&#x7A0B;&#x5E8F;&#x6587;&#x4EF6;&#x53EF;&#x4EE5;&#x6709;&#x4E00;&#x4E2A;&#x6216;&#x591A;&#x4E2A;&#x6E90;&#x7A0B;&#x5E8F;&#x6587;&#x4EF6;&#x7EC4;</li>
<li>&#x4E00;&#x4E2A;C&#x8BED;&#x8A00;&#x7A0B;&#x5E8F;&#x6267;&#x884C;&#x5F00;&#x59CB;&#x4E8E;main()&#xFF0C;&#x7ED3;&#x675F;&#x4E8E;main(),&#x53EF;&#x8C03;&#x7528;&#x5176;&#x4ED6;&#x51FD;&#x6570;</li>
<li>&#x51FD;&#x6570;&#x4E0D;&#x80FD;&#x5D4C;&#x5957;&#x5B9A;&#x4E49;&#xFF0C;&#x4F46;&#x662F;&#x53EF;&#x4EE5;&#x76F8;&#x4E92;&#x8C03;&#x7528;&#xFF0C;&#x4E0D;&#x80FD;&#x8C03;&#x7528;main&#xFF08;&#xFF09;</li>
</ul>
</li>
<li><p>&#x51FD;&#x6570;&#x7684;&#x5206;&#x7C7B;&#xFF1A;</p>
<ul>
<li>&#xFE0F;&#x65E0;&#x53C2;&#x51FD;&#x6570;&#x548C;&#x6709;&#x53C2;&#x51FD;&#x6570;</li>
<li>&#x5E93;&#x51FD;&#x6570;&#x548C;&#x7528;&#x6237;&#x81EA;&#x5B9A;&#x4E49;&#x51FD;&#x6570;+main()</li>
</ul>
</li>
<li><p>&#x539F;&#x578B;&#x58F0;&#x660E;</p>
<ul>
<li>&#x5728;main&#x4E4B;&#x524D;&#x58F0;&#x660E;&#x51FD;&#x6570;&#x5934;&#x90E8;&#x5206;</li>
<li>&#x6CE8;&#xFF1A;<ul>
<li>&#x6709;&#x5934;&#x6709;&#x4F53;&#x65E0;&#x5206;&#x53F7;&#xFF1B;&#x2014;&#x2014;&#x51FD;&#x6570;&#x5B9A;&#x4E49;</li>
<li>&#x6709;&#x5934;&#x65E0;&#x4F53;&#x6709;&#x5206;&#x53F7;&#xFF1B;&#x2014;&#x2014;&#x539F;&#x578B;&#x58F0;&#x660E;</li>
<li>&#x51FD;&#x6570;&#x540D;&#xFF08;&#x5B9E;&#x53C2;&#x5217;&#x8868;&#xFF09;&#xFF1B;&#x2014;&#x2014;&#x51FD;&#x6570;&#x8C03;&#x7528;&#xFF08;&#x5355;&#x5411;&#x4F20;&#x503C;&#x4E09;&#x4E00;&#x81F4;&#xFF09;</li>
</ul>
</li>
</ul>
</li>
<li><p>&#x53D8;&#x91CF;&#x7684;&#x4E09;&#x5C5E;&#x6027;</p>
<ul>
<li>&#x7C7B;&#x578B;&#xFF08;&#x5E38;&#x91CF;&#x3001;&#x53D8;&#x91CF;&#x3001;&#x51FD;&#x6570;&#x3001;&#x8868;&#x8FBE;&#x5F0F;&#xFF09;&#xFF0C;&#x5148;&#x5B9A;&#x4E49;&#x540E;&#x4F7F;&#x7528;</li>
<li><p>&#x4F5C;&#x7528;&#x8303;&#x56F4;&#xFF1A;&#x53D8;&#x91CF;&#x7684;&#x4F4D;&#x7F6E;&#xFF08;&#x5C40;/&#x5916;&#x90E8;&#x53D8;&#x91CF;&#x548C;&#x5168;/(&#x5916;&#x90E8;)&#x5C40;&#x53D8;&#x91CF;&#xFF09;&#xFF0C;&#x7A7A;&#x95F4;&#x4E0A;</p>
<ul>
<li><p>&#x5C40;&#x90E8;&#x53D8;&#x91CF;&#xFF1A;&#x5B9A;&#x4E49;&#x5728;&#x4E00;&#x4E2A;&#x51FD;&#x6570;&#x5185;&#x90E8;&#x7684;&#x53D8;&#x91CF;&#x4E3A;&#x5C40;&#x90E8;&#x53D8;&#x91CF;</p>
<ul>
<li>&#x5C40;&#x90E8;&#x53D8;&#x91CF;&#x53EA;&#x80FD;&#x5728;&#x5B83;&#x6240;&#x5728;&#x7684;&#x51FD;&#x6570;&#x4F53;&#x5185;&#x4F7F;&#x7528;&#x3002;</li>
<li>&#x5728;&#x4E0D;&#x540C;&#x7684;&#x51FD;&#x6570;&#x7684;&#x4E2D;&#x5B9A;&#x4E49;&#x7684;&#x53D8;&#x91CF;&#xFF0C;&#x90FD;&#x53EA;&#x80FD;&#x5728;&#x8BE5;&#x51FD;&#x6570;&#x5185;&#x4F7F;&#x7528;&#xFF0C;&#x5C5E;&#x4E8E;&#x5C40;&#x90E8;&#x53D8;&#x91CF;</li>
<li>&#x590D;&#x5408;&#x8BED;&#x53E5;&#x4E2D;&#x7684;&#x53D8;&#x91CF;&#x4E3A;&#x5C40;&#x90E8;&#x53D8;&#x91CF;</li>
<li>&#x6240;&#x6709;&#x5F62;&#x5F0F;&#x53C2;&#x6570;&#x90FD;&#x662F;&#x5C40;&#x90E8;&#x53D8;&#x91CF;</li>
</ul>
</li>
<li><p>&#x5168;&#x5C40;&#x53D8;&#x91CF;&#xFF1A;&#x5728;&#x51FD;&#x6570;&#x4F53;&#x5916;&#x90E8;&#x5B9A;&#x4E49;&#x7684;&#x53D8;&#x91CF;&#x6210;&#x4E3A;&#x5168;&#x5C40;&#x53D8;&#x91CF;&#x3002;</p>
</li>
<li>&#x4F5C;&#x7528;&#x8303;&#x56F4;&#x4E3A;&#x4ECE;&#x672C;&#x6587;&#x4EF6;&#x5F00;&#x59CB;&#x5230;&#x672C;&#x6587;&#x4EF6;&#x7ED3;&#x675F;&#x7684;&#x8303;&#x56F4;&#x5185;&#x3002;</li>
<li>&#x5168;&#x5C40;&#x53D8;&#x91CF;&#x53EF;&#x4EE5;&#x672C;&#x6587;&#x4EF6;&#x4E2D;&#x90FD;&#x53EF;&#x4EE5;&#x4F7F;&#x7528;&#xFF08;&#x5F15;&#x7528;&#xFF0C;&#x8C03;&#x7528;&#xFF09;&#x3002;</li>
<li>&#x5728;&#x6587;&#x4EF6;&#x4E2D;&#x82E5;&#x5168;&#x90E8;&#x53D8;&#x91CF;&#x4E0E;&#x5C40;&#x90E8;&#x53D8;&#x91CF;&#x540C;&#x540D;&#xFF0C;&#x5219;&#x5C40;&#x90E8;&#x53D8;&#x91CF;&#x4F1A;&#x201C;&#x5C4F;&#x853D;&#x201D;&#x5168;&#x5C40;&#x53D8;&#x91CF;&#x3002;&#x540C;&#x540D;&#x60C5;&#x51B5;&#x4E0B;&#xFF0C;&#xFF08;&#x5C40;&#x90E8;&#x53D8;&#x91CF;&#x4F18;&#x5148;&#x7EA7;&#x9AD8;&#x4E8E;&#x5168;&#x5C40;&#x53D8;&#x91CF;&#xFF09;</li>
</ul>
</li>
<li><p>&#x5B58;&#x50A8;&#x7C7B;&#x522B;&#xFF1A;&#xFF08;auto&#x3001;status&#x3001;register&#x3001;extern&#xFF09;&#x65F6;&#x95F4;&#x4E0A;</p>
<ol>
<li>auto&#x7C7B;&#x522B;&#xFF1A;<ul>
<li>&#x53D8;&#x91CF;&#x7528;&#x5B8C;&#x540E;&#x91CA;&#x653E;&#x6240;&#x5360;&#x7A7A;&#x95F4;</li>
<li>&#x5C40;&#x90E8;&#x53D8;&#x91CF;&#x9ED8;&#x8BA4;&#x4E3A;auto&#x7C7B;&#x522B;&#xFF0C;&#x65E0;&#x521D;&#x59CB;&#x5316;&#x65F6;&#xFF0C;auto&#x53D8;&#x91CF;&#x7684;&#x521D;&#x59CB;&#x503C;&#x4E3A;&#x968F;&#x673A;&#x503C;</li>
<li>&#x4F7F;&#x7528;&#x65F6;&#x95F4;&#x77ED;&#xFF0C;&#x4E00;&#x822C;&#x90FD;&#x4E3A;auto&#x7C7B;&#x522B;</li>
</ul>
</li>
<li>static&#x7C7B;&#x522B;&#xFF08;&#x9759;&#x6001;&#x53D8;&#x91CF;&#xFF09;&#xFF1A;<ul>
<li>static&#x7C7B;&#x522B;&#x4ECE;&#x5B9A;&#x4E49;&#x5230;&#x7A0B;&#x5E8F;&#x8FD0;&#x884C;&#x7ED3;&#x675F;&#x90FD;&#x4F1A;&#x5360;&#x7528;&#x5185;&#x5B58;&#x7A7A;&#x95F4;&#xFF0C;&#x5360;&#x7528;&#x65F6;&#x95F4;&#x957F;</li>
<li>&#x5168;&#x5C40;&#x53D8;&#x91CF;&#x9ED8;&#x8BA4;&#x4E3A;static&#x7C7B;&#x522B;&#xFF0C;&#x65E0;&#x521D;&#x59CB;&#x5316;&#x65F6;&#xFF0C;&#x521D;&#x503C;&#x4E3A;0</li>
<li>==static&#x53EA;&#x80FD;&#x8FDB;&#x884C;&#x4E00;&#x6B21;&#x521D;&#x59CB;&#x5316;&#x3002;&#xFF08;&#x753B;&#x6846;&#x4FDD;&#x62A4;&#xFF0C;&#x5212;&#x6389;&#x4E4B;&#x524D;&#x7684;&#x521D;&#x59CB;&#x503C;&#xFF09;==</li>
</ul>
</li>
<li><p>register&#xFF08;&#x5BC4;&#x5B58;&#x5668;&#x7C7B;&#x522B;&#xFF09;</p>
<ul>
<li>&#xFF08;&#xFF09;&#x53EA;&#x6709;&#x662F;&#x5C40;&#x90E8;&#x53D8;&#x91CF;&#x624D;&#x80FD;&#x522B;&#x4F7F;&#x7528;&#xFF0C;&#x4E00;&#x822C;&#x4E0D;&#x80FD;&#x76F4;&#x63A5;&#x88AB;&#x4F7F;&#x7528;&#x3002;&#x65F6;&#x95F4;&#x5468;&#x671F;&#x975E;&#x5E38;&#x77ED;</li>
</ul>
</li>
<li><p>extern&#x7C7B;&#x522B;</p>
<ul>
<li>extern&#x53EF;&#x4EE5;&#x52A0;&#x5927;&#x53D8;&#x91CF;&#x7684;&#x4F7F;&#x7528;&#x8303;&#x56F4;</li>
<li>&#x4E24;&#x79CD;&#x683C;&#x5F0F;&#xFF1A;<ul>
<li>&#x683C;&#x5F0F;1&#xFF1A;&#x5B9A;&#x4E49;&#x7684;&#x540C;&#x65F6;&#x8BF4;&#x660E;&#x2014;&#x2014;&#x5B58;&#x50A8;&#x7C7B;&#x522B; &#x7C7B;&#x578B;&#x540D; &#x53D8;&#x91CF;&#x540D;&#xFF1B;</li>
<li>&#x683C;&#x5F0F;2&#xFF1A;&#x5206;&#x522B;&#x5B9A;&#x4E49;&#x548C;&#x8BF4;&#x660E;&#x2014;&#x2014;&#x7C7B;&#x578B;&#x540D; &#x53D8;&#x91CF;&#x540D;&#xFF1B;&#x5B58;&#x50A8;&#x7C7B;&#x522B; &#x53D8;&#x91CF;&#x540D;&#xFF1B;</li>
</ul>
</li>
</ul>
</li>
</ol>
</li>
</ul>
</li>
<li><p>&#x9884;&#x7F16;&#x8BD1;&#x547D;&#x4EE4;&#x3001;&#x5B8F;&#xFF08;&#x5FC5;&#x987B;&#x72EC;&#x5360;&#x4E00;&#x884C;&#xFF09;</p>
<ol>
<li>&#x9884;&#x7F16;&#x8BD1;&#x6307;&#x4EE4; <ul>
<li>&#x9884;&#x7F16;&#x8BD1;&#x6807;&#x5FD7;&#xFF0C;#&#x53F7;   </li>
<li>&#x6587;&#x4EF6;&#x5305;&#x542B;&#xFF08;include&#xFF09;</li>
<li><h1 id="include-&#xFF0C;&#x6807;&#x51C6;&#x5E93;&#x4E2D;&#x641C;&#x7D22;">include &lt;&gt;&#xFF0C;&#x6807;&#x51C6;&#x5E93;&#x4E2D;&#x641C;&#x7D22;</h1>
</li>
<li><h1 id="include--&#xFF0C;&#x53CC;&#x5F15;&#x53F7;&#x641C;&#x7D22;&#x8303;&#x56F4;&#x6269;&#x5927;">include &quot;&quot; &#xFF0C;&#x53CC;&#x5F15;&#x53F7;&#x641C;&#x7D22;&#x8303;&#x56F4;&#x6269;&#x5927;</h1>
</li>
</ul>
</li>
<li>&#x5B8F;<ul>
<li>&#x65E0;&#x53C2;&#x6570;&#x5B8F;&#x5B9A;&#x4E49;&#xFF1A;<ul>
<li>&#x683C;&#x5F0F;&#xFF1A;#define  &#x5B8F;&#x540D;    &#x5B8F;&#x5185;&#x5BB9;</li>
<li>&#x529F;&#x80FD;&#xFF1A;&#x7528;&#x4E00;&#x4E2A;&#x6307;&#x5B9A;&#x7684;&#x6807;&#x8BC6;&#x7B26;&#xFF08;&#x5B8F;&#x540D;&#xFF09;&#xFF0C;&#xFF0C;&#x9075;&#x5FAA;&#x7528;&#x6237;&#x81EA;&#x5B9A;&#x4E49;&#x6807;&#x8BC6;&#x7B26;&#x6765;&#x4EE3;&#x8868;&#x4E00;&#x4E32;&#x5B57;&#x7B26;&#xFF08;&#x5B8F;&#x5185;&#x5BB9;&#xFF09;,&#x4E00;&#x822C;&#x5927;&#x5199;</li>
<li>&#x4E3E;&#x4F8B;;# define PI 3.1415926   #define N 10</li>
<li>&#x5B8F;&#xFF1A;&#x7B26;&#x53F7;&#x5E38;&#x91CF;&#x3001;&#x65E0;&#x8BED;&#x53D1;&#x68C0;&#x67E5;&#x3001;&#x65E0;&#x7C7B;&#x578B;</li>
<li>&#x6CE8;&#x610F;&#x4E8B;&#x9879;&#xFF1A;&#xFF08;1&#xFF09;==#define&#x53EF;&#x4EE5;&#x5728;&#x51FD;&#x6570;&#x5916;&#x5B9A;&#x4E49;&#x4E5F;&#x53EF;&#x4EE5;&#x5728;&#x51FD;&#x6570;&#x5185;&#x5B9A;&#x4E49;&#xFF0C;&#x4F46;&#x8BE5;&#x547D;&#x4EE4;&#x5E94;&#x8BE5;&#x4E3A;&#x5355;&#x72EC;&#x4E00;&#x884C;&#xFF0C;#undef&#x53EF;&#x4EE5;&#x63D0;&#x524D;&#x7ED3;&#x675F;&#x5B8F;&#x7684;&#x4F5C;&#x7528;&#x57DF;==&#xFF08;2&#xFF09;&#x5728;&#x8FDB;&#x884C;&#x5B8F;&#x5B9A;&#x4E49;&#x662F;&#xFF0C;&#x53EF;&#x4EE5;&#x5F15;&#x7528;&#x5DF2;&#x7ECF;&#x5B9A;&#x4E49;&#x7684;&#x5B8F;&#x540D;&#xFF0C;&#x8FDB;&#x884C;&#x5C42;&#x5C42;&#x7F6E;&#x6362;&#xFF1B;</li>
<li>&#x5728;==&#x8FDB;&#x884C;&#x5B8F;&#x66FF;&#x6362;&#x65F6;&#xFF0C;&#x5FC5;&#x987B;&#x5148;&#x539F;&#x6A21;&#x539F;&#x6837;&#x66FF;&#x6362;&#x5B8C;&#x6240;&#x6709;&#x7684;&#x5B8F;&#x540E;,&#x518D;&#x8FD0;&#x7B97;&#xFF0C;&#x540C;&#x65F6;&#x66FF;&#x6362;&#x8FC7;&#x7A0B;&#x4E2D;&#x4E0D;&#x80FD;&#x4E71;&#x52A0;&#x7B26;&#x53F7;&#x3002;==</li>
</ul>
</li>
<li>&#x5E26;&#x53C2;&#x6570;&#x5B8F;&#x5B9A;&#x4E49;<ul>
<li>&#x5B9A;&#x4E49;&#xFF1A;#define &#x5B8F;&#x540D;&#xFF08;&#x53C2;&#x6570;&#x5217;&#x8868;&#xFF09;&#x5B8F;&#x5185;&#x5BB9;</li>
<li>&#x529F;&#x80FD;&#xFF1A;&#x63D0;&#x4F9B;&#x4E86;&#x4E00;&#x79CD;&#x66F4;&#x52A0;&#x7075;&#x6D3B;&#x7684;&#x66FF;&#x4EE3;&#x65B9;&#x5F0F;</li>
<li>&#x4E3E;&#x4F8B;&#xFF1A;# define s(x,y) x*y+2</li>
<li>&#x5B8F;&#x540D;&#x540E;&#x9762;&#x7684;&#x53C2;&#x6570;&#x5FC5;&#x987B;&#x5E26;&#x62EC;&#x53F7;</li>
<li>&#x5B8F;&#x540D;&#x548C;&#x62EC;&#x53F7;&#x4E4B;&#x95F4;&#x4E0D;&#x53EF;&#x4EE5;&#x6709;&#x62EC;&#x53F7;</li>
</ul>
</li>
</ul>
</li>
</ol>
</li>
</ol>
<h2 id="&#x9012;&#x5F52;&#x89E3;&#x9898;&#x65B9;&#x6CD5;">&#x9012;&#x5F52;&#x89E3;&#x9898;&#x65B9;&#x6CD5;</h2>
<ol>
<li>&#x8FA8;&#x8BA4;&#x51E0;&#x6761;&#x8BED;&#x53E5;</li>
<li>&#x753B;&#x56FE;</li>
<li>&#x6709;&#x53BB;&#x6709;&#x56DE;&#xFF08;&#x6700;&#x5185;&#x5C42;&#x7684;&#x8FD4;&#x56DE;&#x503C;&#x4F20;&#x9012;&#x4E86;&#x5012;&#x6570;&#x7B2C;&#x4E8C;&#x5C42;&#xFF0C;&#x4EE5;&#x6B64;&#x7C7B;&#x63A8;&#xFF09;</li>
</ol>
<pre class="language-"><code>main(){
    int a=3,b=9;
    {
        int a=1,c=7;
        a=a+b;
        b=a+c;
        printf(&quot;a=%d,b=%d\n&quot;,a,b);
    }
    printf(&quot;a=%d,b=%d&quot;,a,b);
}
</code></pre>
                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="chapter6.html" class="navigation navigation-prev " aria-label="Previous page: 第六章 数组概念">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="chapter8_1.html" class="navigation navigation-next " aria-label="Next page: 第八章 指针类型(1)">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"第七章 函数与预编译","level":"1.8","depth":1,"next":{"title":"第八章 指针类型(1)","level":"1.9","depth":1,"path":"chapter8_1.md","ref":"chapter8_1.md","articles":[]},"previous":{"title":"第六章 数组概念","level":"1.7","depth":1,"path":"chapter6.md","ref":"chapter6.md","articles":[]},"dir":"ltr"},"config":{"plugins":["-lunr","-search","highlight","-livereload","search-plus@^0.0.11","disqus@^0.1.0","prism@^2.1.0","prism-themes@^0.0.2","emphasize@^1.1.0","katex@^1.1.3","splitter@^0.0.8","terminal@^0.3.2","livereload"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"prism":{"css":["prism-themes/themes/prism-base16-ateliersulphurpool.light.css"]},"disqus":{"useIdentifier":false,"shortName":"gitbookuse"},"emphasize":{},"splitter":{},"katex":{},"fontsettings":{"theme":"white","family":"sans","size":2},"highlight":{},"prism-themes":{},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"terminal":{"copyButtons":true,"fade":false,"style":"flat"},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":true},"search-plus":{}},"theme":"default","author":"马小安","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"C语言程序设计精髓程","language":"zh-hans","gitbook":"*","description":"苏小红(哈工大)"},"file":{"path":"chapter7.md","mtime":"2018-01-31T01:17:29.880Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2018-01-31T05:09:23.850Z"},"basePath":".","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="gitbook/gitbook.js"></script>
    <script src="gitbook/theme.js"></script>
    
        
        <script src="gitbook/gitbook-plugin-search-plus/jquery.mark.min.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-search-plus/search.js"></script>
        
    
        
        <script src="https://cdnjs.cloudflare.com/ajax/libs/URI.js/1.16.1/URI.min.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-disqus/plugin.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-splitter/splitter.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-terminal/plugin.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

